from src import Node

from time import sleep
def Interlock_main(ip,wait_time):
        impCtrlMENA = Node.impCtrlMENA()
        impCtrlApply = Node.impCtrlApply()
        impInterlockReadGroup = Node.impInterlockReadGroup()

        impCtrlMENA.set_impCtrlInterlockEna(ip=ip,value=1)
        impCtrlApply.set_impCtrlApply(ip=ip,value=11)
        print(impInterlockReadGroup.walk_impInterlockReadGroup(ip))
        sleep(wait_time)

        impCtrlMENA.set_impCtrlInterlockEna(ip=ip,value=0)
        impCtrlApply.set_impCtrlApply(ip=ip,value=11)
        print(impInterlockReadGroup.walk_impInterlockReadGroup(ip))
        sleep(wait_time)

        impCtrlMENA.set_impCtrlInterlockEna(ip=ip,value=1)
        impCtrlApply.set_impCtrlApply(ip=ip,value=11)
        print(impInterlockReadGroup.walk_impInterlockReadGroup(ip))                 
                        

